﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace ModuleConfig
{
    public class BaudRate
    {
        public int Rate
        {
            get;
            set;
        }
        public string Name
        {
            get;
            set;
        }

        public BaudRate()
        {
        }
    }

    public class CurrentBaudRate : INotifyPropertyChanged
    {
        public CurrentBaudRate()
        { }

        private int _rate = 115200;
        public int Rate
        {
            get { return _rate; }
            set 
            {
                if (_rate != value)
                {
                    _rate = value;
                    NotifyPropertyChanged("Rate");
                }
            }
        }

        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }

}
